package com.blog.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.blog.bean.Blog;
import com.blog.common.ReturnMessage;
import com.blog.dao.BlogMapper;
import com.blog.util.StringUtil;

@Service
@Transactional
public class BlogService {
	@Autowired
	private BlogMapper blogMapper;
	
	public ReturnMessage addBlog(Blog blog){
		blogMapper.addBlog(blog);
		return null; 
	}
	
	public List<Blog> getBlogByType(String blogType){
		List<Blog> blogs = blogMapper.getBlogByType(Integer.parseInt(blogType));
		return blogs;
	}
	
	public Blog getBlogById(int id){
		return blogMapper.getBlogById(id);
	}

	public List<Blog> holleWord() {
		return blogMapper.holleWord();
	}
	
}
